package com.net.orders.fegin;

import com.caikun.model.common.Result;
import com.caikun.model.entity.User;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
@FeignClient(name = "user-service", path = "/user")
public interface OrderUserFegin {
    /**
     * 根据id查询用户
     * @return
     */
    @Operation(summary = "根据id查询用户")
    @GetMapping(value = "/info/{userId}")
    Result<User> getUserInfo(@PathVariable int userId);


    /**
     * 条件查询用户列表
     * @return
     */
    @PostMapping("/queryByCondition")
    @Operation(summary = "条件查询用户列表")
    Result<List<User>> queryByCondition(@RequestBody User user);

}
